<script setup lang="ts">
import { devtools } from "@vue/devtools";
import { router } from "@renderer/router/router";
import { onMounted, provide } from "vue";
import { onConnect, onDisconnect, resolveImg,onContextMenuSelectMsg } from "@renderer/events/mainThreadMsgReceive";
import {
  useSnackbarStore
} from '@renderer/store/pinia/useSnackbarStore'


if (process.env.NODE_ENV === "development") {
  devtools.connect();
}


onMounted(() => {
  // router.push("/quick/123");
  // router.push("/normal/123");
  router.push("/");
});

const snackbarStore = useSnackbarStore();


provide("snackBar", {
  showSnackBar: snackbarStore.showSnackbar,
  hideSnackBar: snackbarStore.hideSnackbar,
});

resolveImg();
onConnect();
onDisconnect();
onContextMenuSelectMsg()
</script>

<template>
  <router-view >
  </router-view>


  <v-snackbar v-model="snackbarStore.snackbarVisible"
              timeout="3000">

    {{ snackbarStore.snackbarMessage }}

    <template v-slot:actions>
      <v-btn color="pink" variant="text" @click="snackbarStore.hideSnackbar">
        Close
      </v-btn>
    </template>
  </v-snackbar>
</template>
